#include "Udp_Client.hpp"

int main(int argc,char* argv[]){
    if(argc != 3){
        printf("Usage ./dict_server [ip] [port]\n");
        return 1;
    }
    UdpClient client(argv[1],atoi(argv[2]));
    std::string word;
    for(;;){
        std::cout<<"输入查询词 : ";
        std::cin>>word;
        if("exit" == word){
            std::cout<<"Good Bye"<<std::endl;
            break;
        }
        client.SendTo(word);
        std::string result;
        client.RecvFrom(&result);
        std::cout << word << " 意思是 : " << result << std::endl;
    }
    return 0;
}